$(document).ready(function() {
	getDeliveryAddress();
});
function getDeliveryAddress() {
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&did="+commondata.groupebusinessoppo+"&token="+basedata.token+"&pagesize=10";
	$.ajax({
		url:'../api/group/getmemberaddresslist',
		type:'post',
		data:Post,
		success:function(msg){
			if (msg.code == 100) {
				var $ul =document.getElementById("del-list");
				for (var i = 0; i < msg.data.length; i++) {
					var $li = document.createElement("li");
					$li.id = msg.data[i].n0;
					$li.innerHTML = '<p><span>姓名:</span>'+
					msg.data[i].n2+'</p><p><span>电话:</span>'+
					msg.data[i].n3+'</p><p><span>地址:</span>'+
					msg.data[i].n4+'</p>';
					$($ul).append($li);
				}
			}
		}
	});
}
function addDeliveryAddress(){
	var $name = $("#name").val();
	var $tel  = $("#tel").val();
	var $addr = $("#addr").val();
	var peopleinfo = "&cname="+$name+"&ctel="+$tel+"&caddress="+$addr+"&isdefault=1";
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&did="
	+commondata.groupebusinessoppo+"&token="+basedata.token+peopleinfo;
	$.ajax({
		url:'../api/group/addmemberaddressinfo',
		type:'post',
		data:Post,
		success:function(msg){
			if(msg.code ==100){
				$("del-list").remove();
				getDeliveryAddress();
			}
		}
	});
}